#pragma once
#include "Mutex.h"
#include <queue>

template<class T>
class LockQueue : std::queue<T>
{
	Mutex mQueueLock;

public:
	void Push(T request)
	{
		MutexLock lock(mQueueLock);
		push(request);
	}

	bool Pop(T& t)
	{
		MutexLock lock(mQueueLock);
		if (empty())
			return false;

		t = front();
		pop();
		return true;
	}
};
